﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Globalization;

public partial class _Default : System.Web.UI.MasterPage
{
    protected void Page_PreRender()
    {
        if ( Context.Profile[ "LanguagePreference" ].ToString().CompareTo( "fr" ) == 0 )
        {
            SiteMapPathMain.SiteMapProvider = "XmlSiteMapProviderFr";
        }
        else if ( Context.Profile[ "LanguagePreference" ].ToString().CompareTo( "en" ) == 0 )
        {
            SiteMapPathMain.SiteMapProvider = "XmlSiteMapProviderEn";
        }

        int i = 45454;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if ( !Page.IsPostBack )
        {
            //SiteMapPathMain.
            int i = 3;
        }
    }

    protected void LinkButtonFr_Click( object sender, EventArgs e )
    {
        Context.Profile[ "LanguagePreference" ] = "fr";
        LinkButtonFr.BackColor = System.Drawing.Color.Gray;
        LinkButtonEn.BackColor = System.Drawing.Color.Transparent;
        Response.Redirect( this.Request.Url.AbsolutePath );
    }

    protected void LinkButtonEn_Click( object sender, EventArgs e )
    {
        Context.Profile[ "LanguagePreference" ] = "en";
        LinkButtonFr.BackColor = System.Drawing.Color.Transparent;
        LinkButtonEn.BackColor = System.Drawing.Color.Gray;
        Response.Redirect( this.Request.Url.AbsolutePath );
    }
}
